package com.myplans.client.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.myplans.client.presenter.ViewUserPresenter.Display;

public class ViewUserView extends Composite implements Display {

	private static ViewUserViewUiBinder uiBinder = GWT
			.create(ViewUserViewUiBinder.class);

	interface ViewUserViewUiBinder extends UiBinder<Widget, ViewUserView> {
	}

	public ViewUserView() {
		initWidget(uiBinder.createAndBindUi(this));
		subscribe.setVisible(false);
	}

	@UiField
	Label userName;
	@UiField
	FlowPanel plansPanel;
	@UiField
	Button subscribe;
	@UiField
	Image picture;
	@UiField
	HTMLPanel picturePanel;
	
	public void setPicture(Image picture) {
		this.picture.setUrl(picture.getUrl());
	}

	public ViewUserView(String firstName) {
		initWidget(uiBinder.createAndBindUi(this));
	}
	
	public Label getUserName() {
		return userName;
	}

	public FlowPanel getPlansPanel() {
		return plansPanel;
	}
	
	public Button getSubscribe() {
		return subscribe;
	}

}
